package com.book.backend;

import java.util.ArrayList;
import java.util.Arrays;

public class TEST {
    public static void main(String[] args) {
        String[] sre = {"f0","f0","f0","f0","f0","f0","f0","f0","f0","f8","f0","f0","f1","f3","f9","f9",
                "1d","0e","58","f2","62","b9","51","bc","0f","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","00","1d","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","00","1d","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","00","1d","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","00","1d","f1","f6","f5","f2","f4","40","40",
                "40","40","40","00","1d","40","40","40","00","1d","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","00","1d",
                "c3","d5","40","00","1d","40","40","40","00","1d","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","00","1d","40","00","1d","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","00","1d","40","40","40","00","1d",
                "40","40","40","00","1d","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","00","1d","40",
                "00","1d","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","00","1d","40","40","40","00","1d","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","00","1d","40","00","1d","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","00","1d","40","40","40","00",
                "1d","40","40","40","00","1d","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","00","1d",
                "40","00","1d","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","00","1d","0e","62","ad","51","db","4c","69","4d","e8",
                "59","44","52","b7","59","d9","4c","6b","56","8c","5d","9c","0f","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","00","1d","40","0e","52","ce","51","e9","4c","6b","5b","ed","0f",
                "f5","0e","60","bb","0f","c1","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","00","1d","d4","c1","c3","c1","e4","40","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","00","1d","40","40","40","40","40","40","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","00","1d","40",
                "40","40","40","40","40","40","40","40","40","40","40","40","40","40","40","40",
                "40","40","40","00","1d","d4","d6","40","00"
        };
        int sum = 0;
        System.out.println(sre.length +"***");
        ArrayList<String> list = new ArrayList<>();
        for (int i=0;i<sre.length;i++){
            if (sre[i].equals("00")){
                //旧
                if (i+1<sre.length && !(sre[i+1].equals("1d"))){
                    list.add(String.valueOf(i+1));
                }
                //新
//                if (i-1>0 && !(sre[i-1].equals("1d"))){
//                    list.add(String.valueOf(i+1));
//                }
                sum++;
                System.out.print(i+1+" ");
            }
        }
        System.out.println();
        if (list.size() > 0){
            sum = sum+list.size()-2;
        }else {
            sum = sum-2;
        }
        System.out.println(sum);
        System.out.println(list.toString());
    }
}
